import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import electron from "vite-plugin-electron";
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    electron([{
      entry: "electron/main.ts",
    },{
      entry: "electron/preload.ts",
      onstart(options) {
        options.reload();
      },
   
     
   
    }
  
  
  ]),
  ],
  server: {
    port: 5173,
  },
  resolve:{
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },

  },
  build: {
    emptyOutDir: false, // 默认情况下，若 outDir 在 root 目录下，则 Vite 会在构建时清空该目录
    outDir: "dist-electron",
    
  },
});
